<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
	<head>
		<title>jquery test</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="js/libs/jquery-1.9.0/jquery.min.js"></script>
        <script>
            var a=10;             //global variable
            function add(){
                var array=[1,2,3,4];
                var b=1;            // local variable
                document.getElementById("a").innerHTML=++a;
                document.getElementById("b").innerHTML=++array[2];
            }
        </script>
        <style>
            div div{
                position: absolute;
                left: 50%;
            }
        </style>
	</head>
	<body>
		<div>
            <div width="200" height='200' style="border:1px black double">dfdjkldfj</div>
            <button id='add' onclick="add();">add</button>
            <p id='a'>testa</p>     
            <p id='b'>testb</p      <!--local variables are deleted when the function is completed.Global variables are deleted when you close the page.-->
        </div>
	</body>
</html>
